package com.zhengxin.service.impl;

import java.io.Serializable;
import java.util.List;

import com.zhengxin.dao.IDepartmentDao;
import com.zhengxin.pojo.Department;
import com.zhengxin.service.IDepartmentService;

public class DepartmentService implements IDepartmentService {

	//注入Dao
	private IDepartmentDao departmentDao;
	
	public void setDepartmentDao(IDepartmentDao departmentDao) {
		this.departmentDao = departmentDao;
	}
	
	//事务控制是在service方法上
	@Override
	public void save(Department department) {
		departmentDao.save(department);
	}

	@Override
	public Department findByid(Serializable id) {
		// TODO Auto-generated method stub
		return departmentDao.findByid(id);
	}

	@Override
	public List<Department> getAll() {
		// TODO Auto-generated method stub
		return departmentDao.getAll();
	}

	@Override
	public void update(Department department) {
		// TODO Auto-generated method stub
		departmentDao.update(department);
	}

	@Override
	public void delete(Serializable id) {
		// TODO Auto-generated method stub
		departmentDao.delete(id);
	}

}
